package com.appkubes.fintech.admin.application.signature.fadada.controller;

import com.appkubes.fintech.admin.application.signature.fadada.service.FadadaSignService;
import com.appkubes.fintech.common.response.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: leeming
 * @Date: 2020-01-10 19:19
 * @Description:
 */

@Slf4j
@Api(tags = "签章")
@RestController
@RequestMapping("/signature/fadada/")
public class FadadaSignController {

    @Resource
    private FadadaSignService fadadaSignService;

    @ApiOperation("自动签章")
    @GetMapping("/signAuto")
    public Response signAuto(@RequestParam("orderKey") String orderKey) {
        return fadadaSignService.signAuto(orderKey);
    }

    @ApiOperation("获取签章合同url")
    @GetMapping("/getContractUrl")
    public Response getContractUrl(@RequestParam("orderKey") String orderKey) {
        return fadadaSignService.getContractUrl(orderKey);
    }

    @GetMapping("/uploadTemplate")
    public Response uploadTemplate() {
        fadadaSignService.uploadTemplate();
        return Response.success();
    }
}
